package com.netctoss.admin.action;

import java.util.ArrayList;
import java.util.List;

import com.netctoss.DAOFactory;
import com.netctoss.admin.dao.IAdminDAO;
import com.netctoss.exception.DAOException;
import com.netctoss.role.entity.Role;

public class ToAddAdminAction {
	private List<Role> roles = new ArrayList<Role>();

	public String execute(){
		IAdminDAO dao = DAOFactory.getAdminDAO();
		try {
			roles = dao.findAllRole();
		} catch (DAOException e) {
			e.printStackTrace();
			return "error";
		}
		return "success";
	}
	
	public List<Role> getRoles() {
		return roles;
	}

	public void setRoles(List<Role> roles) {
		this.roles = roles;
	}
}
